<template>
  <div>
    <van-calendar
      v-model="dateshow"
      @close="closeXX"
      :close-on-click-overlay="true"
      @confirm="onConfirm"
      color="#1989fa"
    />
    <!-- <u-calendar mode="range" :allowSameDay="true"  round="0" showLunar rowHeight="80" :show="dateshow" @confirm="confirm"></u-calendar> -->
  </div>
</template>

<script>
import moment from "moment";
export default {
  props: {
    // 布尔类型
    dateshow: {
      type: Boolean,
    },
  },
  watch: {
    dateshow(val) {
      console.log(val);
    },
  },
  methods: {
    closeXX() {
      this.$emit("closeCalendar", false);
    },
    onConfirm(e) {
    let data = moment(e).format("YYYY-MM-DD");
      this.$emit("calendar", data);
      // console.log(data);
      // this.$emit("calendar", e)
    },
  },
};
</script>
<style>
</style>
<style scoped lang="scss">
</style>